package T01_test_all.test16_arrayList_student;

import java.util.ArrayList;
import java.util.Scanner;

public class T03_toStudentArrayList {
    public static void main(String[] args) {
        ArrayList<T02_StudentArray> list = new ArrayList<>();
//        T02_StudentArray stu = new T02_StudentArray("zhangsan",19);
//        T02_StudentArray stu2 = new T02_StudentArray("lisi",19);
//        T02_StudentArray stu3 = new T02_StudentArray("wangwu",18);
//        list.add(stu);
//        list.add(stu2);
//        list.add(stu3);

        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < 3; i++) {
            T02_StudentArray stu = new T02_StudentArray();
            System.out.println("name");
            stu.setName(sc.next());
            System.out.println("age");
            stu.setAge(sc.nextInt());
            list.add(stu);
        }


        for (int i = 0; i < list.size(); i++) {
            T02_StudentArray ss = list.get(i);
            System.out.println(ss.getName() + "," + ss.getAge());
        }



    }
}
